﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataEditor.ViewModels
{
    public class BaseDataItemViewModel : BaseViewModel
    {
        Boolean _isValid;
        DateTime _validFrom;
        DateTime? _validTo;
        int _id;

        #region Constructors

        public BaseDataItemViewModel(Boolean IsValid, DateTime validFrom, DateTime? validTo, int id)
        {
            _isValid = IsValid;
            _validFrom = validFrom;
            _validTo = validTo;
            _id = id;
        }

        #endregion

        #region Properties

        public int ID
        {
            get
            {
                return _id;
            }
        }

        public Boolean IsValid
        {
            get
            {
                return _isValid;
            }
            set
            {
                _isValid = value;
                NotifyOfPropertyChange(() => IsValid);
            }   
        }

        public DateTime ValidFrom
        {
            get
            {
                return _validFrom;
            }
            set
            {
                _validFrom = value;
                NotifyOfPropertyChange(() => ValidFrom);
            }
        }

        public DateTime? ValidTo { 
            get
            {
                return _validTo;
            }

            set
            {
                _validTo = value;
                NotifyOfPropertyChange(() => ValidTo);
            }
        }
        

        #endregion
    }
}
